<template>
    <div class="box">
        <fanChart ref="fanChartRef" />
    </div>
</template>
<script>
import fanChart from "./fanChart";

export default {
    components: {
        fanChart
    
  },
  mounted(){
    const optionData = [
        {
          name: "未开始", //名称
          value: 0, //值
          itemStyle: {
            //颜色
            color: "rgba(0, 147, 255,0.8)",
          }
        },
        {
          name: "进行中",
          value: 0,
          itemStyle: {
            color: "rgba(128, 252, 216,0.8)",
          }
        },
        {
          name: "已完成",
          value: 0,
          itemStyle: {
            color: "rgba(17, 140, 200,0.8)",
          }
          
        },
      ];
      let jsonArray = [10, 8, 5];
      let optionDataNew = optionData.map((item, index) => {
        item.value = jsonArray[index];
        return item;
      });
      this.$refs.fanChartRef.init(optionDataNew);
  }
}
</script>
